package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.pojo.TbOrder;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author nan
 * @since 2024-06-11
 */
public interface TbOrderMapper extends BaseMapper<TbOrder> {

    @Select("select sum(order_count) orderCount from tb_order_collect where date between #{start} and #{end} ")
    Long getOrderCount(LocalDate start, LocalDate end);

    @Select("select sum(order_total_money) orderAmount from tb_order_collect where date between #{start} and #{end} ")
    Long getOrderAmount(LocalDate start, LocalDate end);
}
